By taking the vertical and horizontal gradients and putting them together, we get the magnitude. Pretty cool, in non math terms this is just an outline of the image. But why is it so hard to see?
This is significantly better! We can actually see the lines without having to squint. But these lines themselves are pretty blurry, I do not like them much.
I only used a slight blur, and even then I would say there are some differences. Overall, it may be a tiny bit smoother but when I look at the image it gives off the feeling as if it is not done yet loading.
Looking at the same method I used as before, but with a slightly different threshold and the blurred image instead, we get a much nicer outline. I'm really happy with this one!
I have to say, getting these to work was such an amazing feeling. Genuinely so happy it worked out! I'll talk about the four images and the method I used. Basically, using the x and y gradients (a slightly different filter this time, known as the prewitt filters), I got the angles of the gradients. This is useful because we can determine the proportion of angles in different regions. I compared multiple rotations and the rotation that gave the highest number of relatively correct angles was the best rotation. From trying out multiple images, it really seems like a small rotation was all it needed, but I checked over a higher region just to be safe/curiosity.
One thing I enjoy about this class is you know something is right by looking at it. Just looking at the rotated building, the unleaning tower of pisa, the granville island entrance, you can tell its more straight. Looking at the histograms is the icing on the cake. The best rotations have an enormous amount of angles near 0, which are vertical lines.
Unfortunately for the squirtle squad, I'd consider their rotation a failure case. The histogram certainly implied that everything was fine, but I don't see it changed all that much - I still have to rotate my eyes to get a level ground that they are standing on! Clearly there are a lot of vertical lines in this rotation, but there is also a lot going on in this picture and there can be many different fequencies and background excitement that can potentially confuse the system I used.
Very honestly, I think I like the first one better, but after looking at it for a while, I do see how it is sharper, but I really liked the brightness I got from the first one. Let's try it out on a different image!
haha get it cause those pencils are sharp and so is the image
I personally do see a small difference here, at a cost - I see the sharper parts even better now, but I think some of the other pencils so beautifully captured now fade more into the background. Regardless, nice! Now, we will test out blurring the image and trying to save it using our unsharp filter.
This is amazing! While it does not look as great as the original image (more grey, some blurriness), there is significant sharpness recovered.
I love all of these images! I think the second one in particular is so well blended I really struggle looking at it but that's what makes it such a good hybrid! The third picture, where I put lebron over a goat's face, can be considered a form of failure case. I tried matching up other sections, but the faces make the best fit between the two. The problem is that there's so much of the goat in the back even when you are supposed to the G.O.A.T. (lebron) in the front. If I blur the goat image so its lower frequency, this causes visibility problems when I try to find it looking at a far distance.
As another note, I tried doing all of this in black and white first but a lot of the fun with this has really come with using colour images. From a raw image perspective, I think high frequency images look better in black and white compared to colour where they're kinda weird, and low frequenncy images always look clean in bw too. There's just something more satisfying about seeing it in colour, and using just one of them in colour looked weird.
When looking at the catdog picture, we can start to see on the laplacian stacks the outline is really just the cat, while near the end of the gaussian stacks, it's just the dog. This matches our hybrid image idea from before.
plt.imshow(orapple, cmap = 'gray')
plt.show()
I must admit, doing this in colour really makes this feel so cool. I don't know what to say other than wow! There's so many applications for this I don't even know where to begin. The bw version was done by combining the laplacian stacks and weighting them by the gaussian stacks of the mask shown above. Sum it up and you get an oraple. The transition to colour is really quick, I just did that same process with each colour channel and stacked them at the end.
Hold on, my guy dragonite has got some sleek looking bags! The image is definitely blurry to say the least, mostly because these images are very differently sized.
And there you have it, a guarantee that Giannis is going to the Raptors next year!